home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3741 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  608 b 

  1. Path: ruger-90.slip.uiuc.edu!user
  2. From: bwood@uiuc.edu (Brett Wood)
  3. Newsgroups: comp.lang.c
  4. Subject: list permutation algorithms
  5. Date: Tue, 30 Jan 1996 16:54:26 -0600
  6. Organization: University of Illinois
  7. Message-ID: <bwood-3001961654260001@ruger-90.slip.uiuc.edu>
  8. NNTP-Posting-Host: ruger-90.slip.uiuc.edu
  9.  
  10. I am looking for a simple algorithm to find all of the possible permutations of 
  11. a one-dimensional array. For example, the permutations of {1,2,3} are:
  12.    {1,2,3}
  13.    {1,3,2}
  14.    {2,1,3}
  15.    {2,3,1}
  16.    {3,1,2}
  17.    {3,2,1} 
  18. Does anyone know one off-hand, or where I might find one?  
  19. Thank you, Brett Wood
  20.